/* Name: requests.h
 * Project: custom-class, a basic USB example
 * Author: Christian Starkjohann
 * Creation Date: 2008-04-09
 * Tabsize: 4
 * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
 * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
 * This Revision: $Id$
 */

/* This header is shared between the firmware and the host software. It
 * defines the USB request numbers (and optionally data types) used to
 * communicate between the host and the device.
 */

#ifndef __REQUESTS_H_INCLUDED__
#define __REQUESTS_H_INCLUDED__

#define PTX_RQ_ILLEGAL_VALUE	0
#define PTX_RQ_SET_BAUDRATE		1
#define	PTX_RQ_SET_DATA_BIT		2
#define PTX_RQ_SET_STOP_BIT		3
#define PTX_RQ_SET_PARITY		4
#	define PTX_PARITY_ODD	1
#	define PTX_PARITY_EVEN	2
#	define PTX_PARITY_NONE	0
#define PTX_RQ_GET_STATUS		5
#	define PTX_STATUS_MAXRT	(1 << 0)
#define PTX_RQ_WRITE			6
#define PTX_RQ_READ				7

typedef enum {
	RQ_IO8_BIT,
	RQ_IO8_RW,
	RQ_RFREG_BIT,
	RQ_RFREG_RW,
	RQ_RESET,
} usb_request_t;

typedef enum {
	U2WRQ_RADIO_WRITE = 0,	// write data to radio
	U2WRQ_RADIO_READ,		// read data from radio buffer
	U2WRQ_RADIO_RESULT,		// get transfer result
	U2WRQ_RADIO_RCOUNT,		// data count from radio read buffer
	U2WRQ_RADIO_REGRW,		// radio chip register read/write
	U2WRQ_RADIO_REGBIT,
	U2WRQ_IO8_RW,			// mcu register read
	U2WRQ_IO8_BIT,
	U2WRQ_MEM8_RW,
	U2WRQ_MEM8_BIT,
	U2WRQ_MCU_RESET,
	U2WRQ_IR_CONFIG,
	U2WRQ_IR_WDATA,
} u2w_request_t;


#endif /* __REQUESTS_H_INCLUDED__ */
